package com.hawthorn.dic.provider;

import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.builder.annotation.ProviderMethodResolver;

/**
 * <p>todo dict privider sql</p>
 * @author: andyten@tom.com | xukaixing@hotmail.com
 * @created: 2021/12/2 3:38 PM
 * @version v1.0.1
 * @copyright: Copyright (c)  andyten
 */
@Slf4j
public class SysDictSqlProvider implements ProviderMethodResolver
{
  public static String findDict()
  {
    StringBuilder sb = new StringBuilder();
    sb.append("select ");
    sb.append(" id,dic_code,label,label_en,parent,type,spell,aspell,sort ");
    sb.append(" from sys_dict ");
    sb.append(" where del_flag = 0");
    sb.append(" order by type asc, sort asc ");
    return sb.toString();
  }

  public static String findDictDivision()
  {
    StringBuilder sb = new StringBuilder();
    sb.append("select ");
    sb.append(" code,dname,sname,spell,type,parent");
    sb.append(" from sys_division ");
    sb.append(" order by code ");
    return sb.toString();
  }

  public static String findDictForTab(String sql)
  {
    return sql;
  }

}
